package C_Paper;

public class C100_18 {
    public static void main(String[] args) {
        int[] m = new int[]{93,95,97,100,102,123,155};
        System.out.println(pd(m, 0, m.length-1, 90) + 1);
        System.out.println(pd(m, 0, m.length-1, 110) + 1);
        System.out.println(pd(m, 0, m.length-1, 130) + 1);
    }
    public static int pd(int[] x,int start,int end,int in){
        if (start == end) return end;
        int min = (start+end) >> 1;
        if (x[min] > in) return pd(x,start,min,in);
        if (x[min+1] < in) return pd(x,min+1,end,in);
        return min+1;
    }
}
